/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package radiostationv41;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author netgirl
 */
@Entity
@Table(name = "MUSIC_PROD_COMPANY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MusicProdCompany.findAll", query = "SELECT m FROM MusicProdCompany m"),
    @NamedQuery(name = "MusicProdCompany.findByMusicProdCompanyId", query = "SELECT m FROM MusicProdCompany m WHERE m.musicProdCompanyId = :musicProdCompanyId"),
    @NamedQuery(name = "MusicProdCompany.findByMusicProdCompanyName", query = "SELECT m FROM MusicProdCompany m WHERE m.musicProdCompanyName = :musicProdCompanyName"),
    @NamedQuery(name = "MusicProdCompany.findByMusicProdCompanyAddress", query = "SELECT m FROM MusicProdCompany m WHERE m.musicProdCompanyAddress = :musicProdCompanyAddress"),
    @NamedQuery(name = "MusicProdCompany.findByMusicProdCompanyTelephone", query = "SELECT m FROM MusicProdCompany m WHERE m.musicProdCompanyTelephone = :musicProdCompanyTelephone")})
public class MusicProdCompany implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MUSIC_PROD_COMPANY_ID")
    private Integer musicProdCompanyId;
    @Basic(optional = false)
    @Column(name = "MUSIC_PROD_COMPANY_NAME")
    private String musicProdCompanyName;
    @Column(name = "MUSIC_PROD_COMPANY_ADDRESS")
    private String musicProdCompanyAddress;
    @Column(name = "MUSIC_PROD_COMPANY_TELEPHONE")
    private String musicProdCompanyTelephone;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "musicProdCompanyId")
    private Collection<Album> albumCollection;

    public MusicProdCompany() {
    }

    public MusicProdCompany(Integer musicProdCompanyId) {
        this.musicProdCompanyId = musicProdCompanyId;
    }

    public MusicProdCompany(Integer musicProdCompanyId, String musicProdCompanyName) {
        this.musicProdCompanyId = musicProdCompanyId;
        this.musicProdCompanyName = musicProdCompanyName;
    }

    public Integer getMusicProdCompanyId() {
        return musicProdCompanyId;
    }

    public void setMusicProdCompanyId(Integer musicProdCompanyId) {
        this.musicProdCompanyId = musicProdCompanyId;
    }

    public String getMusicProdCompanyName() {
        return musicProdCompanyName;
    }

    public void setMusicProdCompanyName(String musicProdCompanyName) {
        this.musicProdCompanyName = musicProdCompanyName;
    }

    public String getMusicProdCompanyAddress() {
        return musicProdCompanyAddress;
    }

    public void setMusicProdCompanyAddress(String musicProdCompanyAddress) {
        this.musicProdCompanyAddress = musicProdCompanyAddress;
    }

    public String getMusicProdCompanyTelephone() {
        return musicProdCompanyTelephone;
    }

    public void setMusicProdCompanyTelephone(String musicProdCompanyTelephone) {
        this.musicProdCompanyTelephone = musicProdCompanyTelephone;
    }

    @XmlTransient
    public Collection<Album> getAlbumCollection() {
        return albumCollection;
    }

    public void setAlbumCollection(Collection<Album> albumCollection) {
        this.albumCollection = albumCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (musicProdCompanyId != null ? musicProdCompanyId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MusicProdCompany)) {
            return false;
        }
        MusicProdCompany other = (MusicProdCompany) object;
        if ((this.musicProdCompanyId == null && other.musicProdCompanyId != null) || (this.musicProdCompanyId != null && !this.musicProdCompanyId.equals(other.musicProdCompanyId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "radiostationv41.MusicProdCompany[ musicProdCompanyId=" + musicProdCompanyId + " ]";
    }
    
}
